"""The grouping constraints vadd test for TAPA."""

# Copyright (c) 2024 RapidStream Design Automation, Inc. and contributors.
# All rights reserved. The contributor(s) of this file has/have agreed to the
# RapidStream Contributor License Agreement.

load("//bazel:tapa_rules.bzl", "tapa_xo")

sh_test(
    name = "nonpipeline-stream-vadd",
    size = "medium",
    srcs = ["//bazel:v++_env.sh"],
    args = ["$(location //tests/apps/vadd:vadd-host)"],
    data = ["//tests/apps/vadd:vadd-host"],
    env = {"TAPA_CONCURRENCY": "1"},
)

sh_test(
    name = "nonpipeline-stream-vadd-xosim",
    size = "enormous",
    timeout = "moderate",
    srcs = ["//bazel:v++_env.sh"],
    args = [
        "$(location //tests/apps/vadd:vadd-host)",
        "--bitstream=$(location nonpipeline-stream-vadd-xo)",
        "--xosim_executable=$(location //tapa/cosim:tapa-fast-cosim)",
        "1000",
    ],
    data = [
        ":nonpipeline-stream-vadd-xo",
        "//tapa/cosim:tapa-fast-cosim",
        "//tests/apps/vadd:vadd-host",
    ],
    tags = [
        "cpu:2",
    ],
)

tapa_xo(
    name = "nonpipeline-stream-vadd-xo",
    src = "vadd.cpp",
    hdrs = ["vadd.h"],
    include = ["."],
    platform_name = "xilinx_u250_gen3x16_xdma_4_1_202210_1",
    top_name = "VecAdd",
    visibility = ["//tests/functional:__subpackages__"],
)
